﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Delonix_Regia_Hotel
{
    public partial class DeluxeRoomBooking : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Convert.ToString(TextBox1_CalendarExtender.StartDate = DateTime.Now);
            Label1.Text = "$" + (421 * Convert.ToInt32(DropDownList1.SelectedValue) * Convert.ToInt32(DropDownList2.SelectedValue));
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string price = Label1.Text;
            string roomtype = Label3.Text;
            string dateofarrival = TextBox1.Text;
            string nights = DropDownList1.SelectedValue;
            string dateofdeparture = Label2.Text;
            string rooms = DropDownList2.SelectedValue;
            Session["dateofarrival"] = dateofarrival;
            Session["nights"] = nights;
            Session["dateofdeparture"] = dateofdeparture;
            Session["rooms"] = rooms;
            Server.Transfer("EnterGuestDetails.aspx?price=" + price + "&roomtype=" + roomtype + "&dateofarrival" + dateofarrival + "&nights" + nights + "&dateofdeparture" + dateofdeparture + "&rooms" + rooms);
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DateTime arrivalDate = Convert.ToDateTime(TextBox1.Text);
            Label2.Text = Convert.ToString(arrivalDate.AddDays(Convert.ToInt32(DropDownList1.SelectedValue)).ToString("dd/MM/yyyy"));
        }
    }
}